]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
layout: Fix old event removal
authorJasper St. Pierre <jstpierre@mecheye.net>
Fri, 15 Feb 2013 02:21:20 +0000 (21:21 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Fri, 15 Feb 2013 21:49:46 +0000 (16:49 -0500)
If we increment our index variable while looping, this means that
firstNewEvent will be one higher than it should. With a length 1
array, all events will be removed, so this has a cascading effect
that events will not be stored at all.

https://bugzilla.gnome.org/show_bug.cgi?id=693854

js/ui/layout.js

index 26d239328ea8b8a2fc428025b448b5898c6290c3..cae7f8187ad38558ed7ab0ff57b2b86f3889f964 100644 (file)
@@ -1176,8 +1176,9 @@ const PressureBarrier = new Lang.Class({
         // and then chop events after that off.
         let i = 0;
         while (i < this._barrierEvents.length) {
-            if (!this._isBarrierEventTooOld(this._barrierEvents[i++]))
+            if (!this._isBarrierEventTooOld(this._barrierEvents[i]))
                 break;
+            i++;
         }
 
         let firstNewEvent = i;